import { Column, Entity, PrimaryGeneratedColumn, CreateDateColumn } from 'typeorm';

@Entity('note_content')
export class NoteContentData {
  @PrimaryGeneratedColumn({
    type: 'bigint',
    name: 'note_id',
    comment: '主键id',
  })
  id: string;

  @Column({
    type: 'bigint',
    name: 'user_id',
    comment: '用户id',
  })
  userId: bigint | string;

  email: string;

  @Column({
    type: 'varchar',
    default: '',
    length: 50,
    name: 'title',
    comment: '标题',
  })
  title: string;

  @Column({
    type: 'varchar',
    default: '',
    length: 50,
    name: 'note_username',
    comment: '标题',
  })
  noteUsername: string;

  @Column({
    type: 'text',
    name: 'text',
    comment: '笔记内容',
  })
  text: string;

  @Column({
    type: 'int',
    default: 0,
    name: 'like',
    comment: '点赞',
  })
  like: number;

  @Column({
    type: 'int',
    default: 0,
    name: 'note_public',
    comment: '是否公开',
  })
  isPublic: number;

  @Column({
    type: 'int',
    default: 0,
    name: 'see',
    comment: '浏览',
  })
  see: number;

  @Column({
    type: 'boolean',
    default: false,
    name: 'topping',
    comment: '置顶',
  })
  isTopping: boolean;

  @Column({
    type: 'varchar',
    default: '',
    name: 'image_url',
    comment: '图片',
  })
  imageUrl: string;

  @CreateDateColumn({
    type: 'timestamp',
    nullable: false,
    name: 'create_time',
    comment: '创建时间',
  })
  createTime: Date;
}

export default NoteContentData;
